﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using DesigneSpaceExplorerVEGA.Models;

namespace DesigneSpaceExplorerVEGA.Windows
{
    /// <summary>
    /// Interaction logic for Settings.xaml
    /// </summary>
    public partial class Settings : Window
    {
        public Settings(ApplicationModel model)
        {
            DataContext = model;
            InitializeComponent();
            
        }

        private void TextBoxBase_OnTextChanged(object sender, TextChangedEventArgs e)
        {
            if (!Regex.IsMatch(((TextBox) sender).Text, "[^0-9]")) return;
            MessageBox.Show("Inserati numai numere (zecimal)!");
            ((TextBox) sender).Text = "";
        }

        private void DoneSetting_Click(object sender, RoutedEventArgs e)
        {
            Close();
        }
    }
}
